import Vue from "vue"
import App from "./App.vue"
import router from "./router"
// import store from './store'
import "./plugins/element.js"
import "./assets/style/reset.css"

Vue.config.productionTip = false

// 导航守卫
router.beforeEach((to, from, next) => {
  if (to.path !== "/login" && to?.meta?.requireAuth) {
    const token = localStorage.getItem("TOKEN")
    if (!token) {
      return next({ name: "Login" })
    }
  }
  console.log(1234,` 1234 `);
  next()
})

new Vue({
  router,
  // store,
  render: h => h(App)
}).$mount("#app")
